<template>
	<view class="page s-flex-c-c-c">
		<view class="box s-flex-c-s-c">
			<view class="title1">扫描获取</view>
			<view class="title2">测评分数及专属定制方案</view>
			<image class="qrCode" :show-menu-by-longpress="true" :src="details.customer_qrcode_img"></image>
		</view>
	</view>
</template>

<script setup>
	import {getCurrentInstance,ref} from "vue"
	const {
		proxy
	} = getCurrentInstance();
	import {
		onLoad,
	} from "@dcloudio/uni-app"
	const details = ref({})
	const id = ref("")
	onLoad((e) => {
		id.value = e.id;
		getDetails();
	});
	function posterSure(url){
	    uni.downloadFile({
	        url,
	        success: function (res) {
	            console.log(res)
	            wx.saveImageToPhotosAlbum({
	                filePath: res.tempFilePath,
	                success: function (res) {
	                    console.log(res)
	                    console.log('success')
	                    if (res.statusCode === 200) {
	                        proxy.$toast(`请输入姓名`)
	                    }
	                },
	                fail: function (res) {
	                    console.log(res)
	                    console.log('fail')
	                }
	            })
	        },
	        fail: function () {
	            console.log('fail')
	        }
	    })
	}
	// 获取项目详情
	function getDetails() {
		proxy
			.$request({
				url: "api/Service/getServiceDetail",
				header: "application/x-www-form-urlencoded",
				data: {
					id: id.value
				},
			})
			.then((res) => {
				details.value = res.data;
			});
	}
	
</script>

<style lang="scss" scoped>
	.page{
		/* #ifdef H5 */
		height: calc(100vh - var(--window-top) - var(--window-bottom));
		/* #endif */
		/* #ifndef H5 */
		height: 100vh;
		/* #endif */
		.box{
			border-radius: 8rpx;
			background: #FFFFFF;
			width: 680rpx;
			padding: 60rpx 0;
			.title1{
				font-size: 36rpx;
				font-weight: bold;
				margin-bottom: 12rpx;
			}
			.title2{
				font-size: 28rpx;
				font-weight: bold;
				margin-bottom:20rpx;
			}
			.qrCode{
				width: 360rpx;
				height: 360rpx;
			}
		}
	}
</style>
